﻿Public Class Retapa

    Public Shared Function SeleccionarTodo(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean) As List(Of Eetapa)
        Dim etapas As List(Of Eetapa) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                etapas = Detapa.SeleccionarTodo(descEmpresa)
                If etapas Is Nothing Then etapas = New List(Of Eetapa)
                If DisplaySelect Then etapas.Insert(0, New Eetapa("00", "-- SELECCIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return etapas
    End Function
    Public Shared Function SeleccionarTodo(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal idProyecto As Int32) As List(Of Eetapa)
        Dim etapas As List(Of Eetapa) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                etapas = Detapa.SeleccionarTodo(descEmpresa, idProyecto)
                If etapas Is Nothing Then etapas = New List(Of Eetapa)
                If DisplaySelect Then etapas.Insert(0, New Eetapa("00", "-- SELECCIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return etapas
    End Function
    Public Shared Function SeleccionarTodoXetapa(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal eetapa As Eetapa) As List(Of Eetapa)
        Dim etapas As List(Of Eetapa) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                etapas = Detapa.SeleccionarTodoXetapa(descEmpresa, eetapa)
                If etapas Is Nothing Then etapas = New List(Of Eetapa)
                If DisplaySelect Then etapas.Insert(0, New Eetapa("00", "-- SELECCIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return etapas
    End Function

End Class
